<div class="modal-header dialog-header-confirm">
    <h4 class="modal-title text-center">
        <i class="fa fa-plus-square-o"></i>{{ 'roleMgr.add.title' | translate}}
    </h4>
</div>
<div class="modal-body">
    <ng-form name="addRoleDialog" novalidate role="form">
        <div class="form-group input-group-lg" ng-class="{true: 'has-error'}[addRoleDialog.code.$dirty && addRoleDialog.code.$invalid]">
            <label class="control-label" for="name">{{ 'roleMgr.roleName' | translate}}:</label>
            <input type="text" class="form-control" placeholder="{{ 'roleMgr.roleName' | translate}}" name="name" id="name" ng-model="role.name">
            <label class="control-label" for="code">{{ 'roleMgr.roleCode' | translate}}:</label>
            <br />
            <div id="code" class="btn-group" uib-dropdown is-open="roleAddRoleCodesDropdown.isOpen">
                <button type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">
                    <span ng-bind="roleAddRoleCodesDropdown.option.code"></span>
                    <span class="caret"></span>
                </button>
                <ul uib-dropdown-menu role="menu" aria-labelledby="single-button">
                    <li ng-repeat="it in roleAddRoleCodesDropdown.items">
                        <a ng-click="roleAddRoleCodesDropdown.selectOption(it)" ng-bind="it.code"></a>
                    </li>
                </ul>
            </div>
            <br />
            <label class="control-label" for="description">{{ 'roleMgr.roleDesc' | translate}}:</label>
            <textarea style="height:120px;" id="description" name="description" class="form-control" placeholder="{{ 'roleMgr.roleDesc' | translate}}" ng-model="role.description"></textarea>
            <br />
            <span class="text-danger"><strong>{{msg}}</strong></span>
        </div>
    </ng-form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" ng-click="cancel()">{{'dialog.cancel' | translate}}</button>
    <button type="button" class="btn btn-primary" ng-click="save()"
            ng-disabled="(addRoleDialog.$dirty && addRoleDialog.$invalid) || addRoleDialog.$pristine">{{'dialog.save' | translate}}</button>
</div>
